# import tkinter as tk
# from tkinter import messagebox

# def show_hello():
#     """当按钮被点击时显示Hello消息框"""
#     messagebox.showinfo("问候", "Hello!")

# # 创建主窗口
# root = tk.Tk()
# root.title("Hello程序")
# root.geometry("300x200")  # 设置窗口大小

# # 创建一个框架来放置按钮，并使其居中
# frame = tk.Frame(root)
# frame.pack(expand=True)

# # 创建按钮
# hello_button = tk.Button(
#     frame,
#     text="点击这里",
#     command=show_hello,
#     font=("Arial", 12),
#     padx=10,
#     pady=5,
#     bg="#4CAF50",  # 设置按钮背景颜色为绿色
#     fg="white"     # 设置文字颜色为白色
# )
# hello_button.pack(pady=20)

# # 运行主循环
# root.mainloop()















# import tkinter as tk
# from tkinter import messagebox

# class ThreeStepButton:
#     def __init__(self, root):
#         self.root = root
#         self.root.title("三步按钮程序")
#         self.root.geometry("400x300")
        
#         # 设置窗口背景色
#         self.root.configure(bg="#f0f0f0")
        
#         # 创建一个框架来放置内容
#         self.main_frame = tk.Frame(root, bg="#f0f0f0")
#         self.main_frame.pack(expand=True, fill="both", padx=20, pady=20)
        
#         # 创建标题标签
#         self.title_label = tk.Label(
#             self.main_frame,
#             text="三步按钮演示",
#             font=("Arial", 16, "bold"),
#             bg="#f0f0f0"
#         )
#         self.title_label.pack(pady=(0, 20))
        
#         # 创建状态显示标签
#         self.status_label = tk.Label(
#             self.main_frame,
#             text="当前状态: 第1步",
#             font=("Arial", 12),
#             bg="#f0f0f0"
#         )
#         self.status_label.pack(pady=(0, 30))
        
#         # 初始化按钮点击次数
#         self.click_count = 0
        
#         # 创建按钮
#         self.button = tk.Button(
#             self.main_frame,
#             text="下一页",
#             command=self.button_click,
#             font=("Arial", 12),
#             padx=20,
#             pady=10,
#             bg="#4CAF50",
#             fg="white",
#             relief=tk.RAISED,
#             borderwidth=2
#         )
#         self.button.pack()
    
#     def button_click(self):
#         """处理按钮点击事件"""
#         self.click_count += 1
        
#         if self.click_count == 1:
#             # 第一次点击
#             self.status_label.config(text="当前状态: 第2步")
#             self.button.config(text="下一页")
        
#         elif self.click_count == 2:
#             # 第二次点击
#             self.status_label.config(text="当前状态: 第3步")
#             self.button.config(text="点击查看结果")
        
#         elif self.click_count == 3:
#             # 第三次点击
#             messagebox.showinfo("问候", "你好！")
#             # 重置按钮状态
#             self.click_count = 0
#             self.status_label.config(text="当前状态: 第1步")
#             self.button.config(text="下一页")

# # 创建主窗口并运行程序
# if __name__ == "__main__":
#     root = tk.Tk()
#     app = ThreeStepButton(root)
#     root.mainloop()


















# # print absolute value of an integer:
# a = 4
# if a >= 0:
#     print(a)
# else:
#     print(-a)



# print(0xa1b2_c3d4)

# print('I\'m ok.')
# print('I\'m learning\nPython.')
# print('\\\n\\')
# print(r"\\\t//")
# print('''L1
# L2
# L3''')

# print(r'''hello,\n
# world''')

# age = 19
# if age >= 20:
#     print('old')
# else:
#     print('kid')

# a = 123
# print(a)
# a = 'ABC'
# print(a)

# x = 10
# x = x + 2
# print(x)

# a = 'ABC'
# b = a
# a = 'XYZ'
# print(b)

# x = 10 % 3
# print(x)

# n = 123
# f = 456.789
# s1 = 'Hello, world'
# s2 = 'Hello, \'Adam\''
# s3 = r'Hello, "Bart"'
# s4 = ('Hello, \nBob!')

# print(s4)

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

# print(1024 * 768)

# print('yes\nor\nnot')

# print('''hello,\n world''')

# print(chr(25991))

# names = ['Michael', 'Bob', 'Tracy', 'Jack']
# scores = [95, 75, 85, 65]
# print(scores[3])

# s = {1, 1, 2, 2, 3, 3}
# print(s)

# s = {1, 2, 3}
# print(s)
# s.add(4)
# print(s)
# s.remove(4)
# print(s)
# s1 = {1, 2, 3}
# s2 = {3, 4, 5}
# print(s1 & s2)
# print(s1 | s2)

# a = ['6', '8', '2', '0', '1', '5', '3']
# a.sort()
# print(a)

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

# d = {
#     'Michael': 95,
#     'Bob': 75,
#     'Tracy': 85
# }
# print('d[\'Michael\'] =', d['Michael'])
# print('d[\'Bob\'] =', d['Bob'])
# print('d[\'Tracy\'] =', d['Tracy'])
# print('d.get(\'Thomas\', -1) =', d.get('Thomas', -1))

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

# s1 = {1, 1, 2, 2, 3, 3}
# print(s1)
# s2 = {2, 3, 4}
# print(s1 & s2)
# print(s1 | s2)

# total = sum(range(1, 101))
# print(total)

# max(9, 2, 6)

# n1 = 255
# n2 = 1000
# print(hex(n1), hex(n2))

# def my_abs(x):
#     if x >= 0:
#         return x
#     else:
#         return -x
    
# print(my_abs(-99))

# def my_abs(x):
#     if not isinstance(x, (int, float)):
#         raise TypeError('bad operand type')
#     if x >= 0:
#         return x
#     else:
#         return -x






# import tkinter as tk
# from tkinter import messagebox

# def show_hello():
#     """按钮点击事件处理函数，显示"你好"消息框"""
#     messagebox.showinfo("问候", "你好！")

# # 创建主窗口
# root = tk.Tk()
# root.title("按钮示例")
# root.geometry("300x200")  # 设置窗口尺寸

# # 添加欢迎文本
# welcome_label = tk.Label(root, text="欢迎", font=("微软雅黑", 24))
# welcome_label.pack(pady=30)  # 添加垂直间距

# # 创建按钮
# hello_button = tk.Button(root, text="点击这里", command=show_hello, 
#                          font=("微软雅黑", 12), padx=10, pady=5)
# hello_button.pack()

# # 启动主循环
# root.mainloop()




